﻿<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%option explicit%>
<%
Dim RZ_IN
RZ_IN=1
%>
<!--#include file="../conn.inc.asp" -->
<!--#include file="admin_inc/admin.function.asp" -->
<!--#include file="admin_inc/admin.sqlfunction.asp" -->
<!--#include file="../asp/articlelist.asp" -->
<!--#include file="../asp/productlist.asp" -->
<!--#include file="../asp/photolist.asp" -->
<!--#include file="../asp/joblist.asp" -->

<%
checkadmin(1)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>生成列表页</title>
<link type="text/css" href="style/style.css" rel="stylesheet" rev="stylesheet"/>
</head>
<body style="margin-left:50px;margin-top:0px;">
<%
Dim proc,path,cnpage,enpage,totalpages,static_path,startpage,lang,pageper,endpage,typeid
proc=Trim(request.querystring("proc"))
path=Trim(request.querystring("path"))
static_path=Replace(path,",","-")
cnpage=CInt(Trim(request.querystring("cnpage")))
enpage=CInt(Trim(request.querystring("enpage")))
startpage=Trim(request.querystring("startpage"))
lang=Trim(request.querystring("lang"))
typeid=Trim(request.querystring("typeid"))

pageper=50 '每次生成列表数
If typeid<>"" Then 
	Dim rst,sqlt
	Set rst = Server.CreateObject("ADODB.Recordset")
	sqlt = "select * from [c_type] where id="&typeid
	rst.open sqlt,conn,1,3
	rst("makehtmltime")=Now()
	rst.update
	rst.close
	Set rst=Nothing
End If 
If lang="" Then
	lang=0
End If
If startpage="" Then 
	startpage=0
End If 
endpage=startpage+pageper
If endpage>cnpage And lang=0 Then 
	endpage=cnpage
End If 
If endpage>enpage And lang=1 Then 
	endpage=enpage
End If 
Dim count
If lang=0 Then 
count=endpage
Else
count=cnpage+endpage
End If 
If lang=0 Or (lang=1 And enpage<>endpage) Then 
response.write("<span style='color:blue;'>正在生成第<span style='color:red'><b>"&count&"</b></span>个列表……")
End If 
Call MakeList(proc,path,lang,startpage,endpage)
If (lang=1 And enpage=endpage) Or (app("rz_language")=1 And endpage=cnpage) Then 
%>
<span style="color:blue;">成功生成<%If app("rz_language")=2 Then response.write(cnpage+endpage) Else response.write(cnpage) End If %>个列表</span>
<script type="text/javascript">
<!--
	parent.document.getElementById("mon").value="list<%=path%>done";
//-->
</script>

<%
Else 
	If endpage=cnpage Then 
		lang=1
		startpage=0
	Else 
		startpage=endpage+1
	End If 
	Dim url
	url="makehtml_list.asp?proc="&proc&"&path="&path&"&cnpage="&cnpage&"&enpage="&enpage&"&startpage="&startpage&"&lang="&lang&""
	response.write("<meta http-equiv='refresh' content='1;url="&url&"'>")
	response.write("<a href='"&url&"'>如果没有自动跳转，请点击这里</a>")
End If 
%>
</body>
</html>